/*************************************************************************
    > File Name: test.c
	> company: GDOU
    > Mail: lsy476941913@live.com
    > Created Time: 2017年03月5日 星期四 20时36分17秒
 ************************************************************************/

#include <stdio.h>
#include "lcd.h"
#include "show_bmp.h"
#include "ts.h"
#include "decide_pos.h"
#include "show_piano.h"
#include "mp3_play.h"
#include "argopt.h"

extern uint8_t key_status[12];
extern int ts_fd;
extern pthread_t p_mp3_id;
extern bool release;
extern bool pre_release;
extern int new_key;
extern int old_key;
extern bool key_first_time[12];

int key_num;
	
int
main(int argc,char **argv)
{
	release  	= true;
	pre_release 	= true;
	p_mp3_id 	= 0;
	new_key  	= 0;
	old_key 		= 0;
	argopt(argc,argv,"as");
	lcd_init();
	show_piano();
	for(key_num=0;key_num<12;key_num++){
			key_status[key_num]=KEY_OFF;
			key_first_time[key_num] = false;
	}
	init_ts();
	
	while (1) {
  		decide_pos();
	}
	close_ts(ts_fd);
	return 0;
}

